package com.heima.result;

import lombok.Data;

@Data
public class UploadResult {
    private Integer code; //编码：1成功，0和其它数字为失败
    private String msg; //错误信息
    private Object fileName; //数据

    public static UploadResult success(){
        UploadResult result = new UploadResult();
        result.code = 200;
        result.msg = "操作成功";
        return result;
    }

    public static UploadResult success(Object object){
        UploadResult result = new UploadResult();
        result.fileName = object;
        result.code = 200;
        result.msg = "操作成功";
        return result;
    }

    public static UploadResult error(){
        UploadResult result = new UploadResult();
        result.code = 500;
        result.msg = "上传失败";
        return result;
    }
}
